package com.shf.controller;

import com.github.pagehelper.PageInfo;
import com.shf.entity.Syslog;
import com.shf.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

/**
 * 日志控制层
 *
 * @author 叶枫
 */
@Controller
@RequestMapping("/admin/log/")
public class LogController {
    @Autowired
    private LogService logService;

    @RequestMapping("findAll")
    public ModelAndView showLogAll(@RequestParam("page") Integer page ,@RequestParam("size") Integer size , ModelAndView mv){
       PageInfo<Syslog> syslogPageInfo =  logService.findAll(page,size);

       mv.addObject("pageInfo",syslogPageInfo);
       mv.setViewName("log/syslog-list");
        return mv;

    }
}
